#!/usr/bin/python
#coding:utf-8

import json;
import codecs;

cs = codecs.lookup("gbk");

st = "abcdefg啊不过的";

ms = cs.encode(st);

print type(ms),ms[0][0];

b = bytearray(st);

print type(b),b[0];

b = buffer(st);

print type(b),b[0];

"""
obj = {"aa":1,"bb":2,"cc":"中文","dd":{"a":1,"b":2,"c":3},"ee":[{"a":1,"b":2,"c":3},{"a":1,"b":2,"c":3}]}
#obj = [1,"a",2]

encodeJson = json.dumps(obj,sort_keys=True,indent=4);

print encodeJson;

o = json.loads(encodeJson);

print o["cc"];
"""